/**
 * This file is part of Idegen, the application to create IDE project files.
 *
 * @copyright Copyright (c) 2011-2012, Walter Tamboer http://waltertamboer.nl
 * @file Idegen/Idegen/IdegenSourceSet.hpp
 */

#ifndef IDEGEN_IDEGEN_IDEGENSOURCESET_HPP
#define IDEGEN_IDEGEN_IDEGENSOURCESET_HPP

namespace Idegen
{
	class IdegenProjectFilter;

	/** The definition of a source set. */
	class IdegenSourceSet: public IdegenProjectFilter
	{
	public:
		/** Initializes a new instance of this class. */
		IdegenSourceSet();

		/** Cleans up all the resources used by this class. */
		virtual ~IdegenSourceSet();

		/**
		 * Unserializes a source set.
		 *
		 * @param[in] settings The settings used to parse.
		 * @param[in] parent The parent element.
		 */
		void Unserialize( Settings* settings, TiXmlElement* parent );

	private:
		/**
		 * Parses a source directory.
		 *
		 * @param[in] element The element to parse.
		 * @param[in] settings The settings used to parse.
		 * @param[in] filter The filter to use as a parent.
		 */
		void ParseDirectory( IdegenProjectFilter* filter, Settings* settings, TiXmlElement* element );
		
		/**
		 * Parses an element.
		 *
		 * @param[in] element The element to parse.
		 * @param[in] settings The settings used to parse.
		 * @param[in] filter The filter to use as a parent.
		 */
		void ParseElement( IdegenProjectFilter* filter, Settings* settings, TiXmlElement* element );

		/**
		 * Parses a source file.
		 *
		 * @param[in] element The element to parse.
		 * @param[in] settings The settings used to parse.
		 * @param[in] filter The filter to use as a parent.
		 */
		void ParseFile( IdegenProjectFilter* filter, Settings* settings, TiXmlElement* element );

		/**
		 * Parses a filter.
		 *
		 * @param[in] element The element to parse.
		 * @param[in] settings The settings used to parse.
		 * @param[in] filter The filter to use as a parent.
		 */
		void ParseFilter( IdegenProjectFilter* filter, Settings* settings, TiXmlElement* element );
	};
}

#endif
